﻿<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" href="../Css/Navigation.css" type="text/css">
    <link rel="stylesheet" href="../Css/SelectControl.css" type="text/css">
    <link rel="stylesheet" href="../Css/CouponsGeneration.css" type="text/css">
</head>
<body ng-app="">
    <div class="css_main">
        <div class="css_top">
            <div class="css_top_left">
                <span>美位生活 & meiwei life</span><br>
                <span>App 管理操作后台</span>
            </div>
            <div class="css_top_right">
                <span style="Float:right">欢迎！Lain</span><br>
                <span style="Float:right">2015.02.08 09:35 AM</span>
            </div>
        </div>
        <div class="css_body">
            <div class="css_navigation">
                <div class="css_navigationItem">
                    <ul>商 户 添 加</ul>
                    <li><span class="css_inActive">&#12288</span><a href="IDelicious.html">爱 美 味</a></li>
                    <li><span class="css_inActive">&#12288</span><a href="EnjoyLife.html">乐 生 活</a></li>
                </div>
                <div class="css_navigationItem">
                    <ul><a href="BusinessInformation.html">商 户 信 息</a></ul>
                </div>
                <div class="css_navigationItem">
                    <ul>分 类 管 理</ul>
                    <li><span class="css_inActive">&#12288</span><a href="AppCategory.html">APP 类 目</a></li>
                    <li><span class="css_inActive">&#12288</span><a href="SceneClassification.html">场 景 分 类</a></li>
                    <li><span class="css_inActive">&#12288</span><a href="AreaClassificationOne.html">区 域 分 类</a></li>
                </div>
                <div class="css_navigationItem">
                    <ul><a href="UserInfo.html">用 户 信 息</a></ul>
                </div>
                <div class="css_navigationItem">
                    <ul>服 务 设 置</ul>
                    <li><span class="css_inActive">&#12288</span><a href="ServicesModification.html">服 务 修 改</a></li>
                    <li><span class="css_active"> > </span><a class="css_active" href="CouponsGeneration.html">折 扣 券 生 成</a></li>
                    <li><span class="css_inActive">&#12288</span><a href="CouponsStatus.html">折 扣 券 状 态</a></li>
                </div>
                <div class="css_navigationItem">
                    <ul>广 告 设 置</ul>
                    <li><span class="css_inActive">&#12288</span><a href="AdSetting.html">广 告 设 置</a></li>
                    <li><span class="css_inActive">&#12288</span><a href="AddEvents.html">添 加 活 动</a></li>
                    <li><span class="css_inActive">&#12288</span><a href="EventsList.html">活 动 列 表</a></li>
                    <li><span class="css_inActive">&#12288</span><a href="TransactionList.html">成 交 列 表</a></li>
                </div>
                <div class="css_navigationItem">
                    <ul>文 章 管 理</ul>
                    <li><span class="css_inActive">&#12288</span><a href="ArticleList.html">文 章 列 表</a></li>
                    <li><span class="css_inActive">&#12288</span><a href="AddArticle.html">添 加 文 章</a></li>
                </div>
                <div class="css_navigationItem">
                    <ul><a href="DataExport.html">数 据 管 理</a></ul>
                </div>
            </div>
            <div class="css_content">
                <div class="css_content_userTable">
                    <div class="css_content_userTable_title">
                        <div class="css_content_userTable_title_name">
                            <span>折扣券生成</span>
                        </div>

                    </div>

                    <div>

                        <div ng-controller="customersController" class="css_content_couponsGeneration">
                            <div class="css_content_coupons">
                                <img src="../Img/Img_quanNo.png" />
                                <div class="css_name">券数量</div>
                                <input ng-model="ticket.num" type="text" />
                            </div>
                            <div class="css_content_coupons_amount">
                                <img src="../Img/Img_quanAmount.png" />
                                <div class="css_name">折扣金额</div>
                                <input ng-model="ticket.amount" type="text" />
                            </div>
                            <div class="css_content_coupons_time">
                                <img src="../Img/Img_quanTime.png" />
                                <div class="css_name">有效期</div>
                                <input ng-model="ticket.limitTime" type="text" />
                            </div>
                            <div class="css_content_button_groups">
                                <input ng-click="genCode(ticket)" id="btnGenCode" class="css_button_genarate" type="button" value="生成" />
                                <input class="css_button_reInput" type="button" value="重填" />
                            </div>
                        </div>

                        <div ng-controller="getTicketInfoController" class="CouponsStringOfCode">
                            <div>
                                <table id="contentTable">
                                    <thead>
                                    <td colspan=2>折扣券串码</td>
                                    </thead>
                                    <tbody ng-repeat="item in tickets" ng-if="$index % 2 ==0">
                                        <tr>
                                            <td ng-if="$index+0<tickets.length" colspan=1.5>{{tickets[$index+0].Code}}</td>
                                            <td ng-if="$index+1<tickets.length" colspan=1.5>{{tickets[$index+1].Code}}</td>

                                        </tr>
                                        <!--<tr><td colspan=1.5>123456789</td><td colspan=1.5>123456789</td></tr>
        <tr><td>123456789</td><td>123456789</td></tr>
        <tr><td>123456789</td><td>123456789</td></tr>
        <tr><td>123456789</td><td>123456789</td></tr>
        <tr><td>123456789</td><td>123456789</td></tr>-->

                                    </tbody>
                                </table>
                                <table id="pageTable">
                                    <tr>
                                        <td><a href="#">上一页</a></td>
                                        <td>2 to 3</td>
                                        <td><a href="#">下一页</a></td>
                                    </tr>
                                </table>
                            </div>
                            <div>
                                <input class="css_button_genarate" style="float: right" type="button" value="保存并导出" />
                            </div>

                        </div>
                    </div>
                </div>


                <br>
                <br>
                <br>
                <br>
            </div>
        </div>
    </div>

    <script>

        function getTicketInfoController($scope, $http) {

            $scope.tickets = [];
            var url = '../WebService1.asmx/GetTicketStatusInfo';

            $http.get(url)
                 .success(function (response) {
                     if (response != undefined) {
                         //var result = JSON.parse(response)
                         $scope.tickets = response;

                     }
                 })
                 .error(function (data, status, headers, config) {
                     alert("error");
                 })
        }
        function customersController($scope, $http) {
            $scope.ticket =
                {
                    num: "",
                    amount: "",
                    limitTime: ""
                }

            var url = '../WebService1.asmx/GenTicketInfo',

            transFn = function (ticket) {
                return $.param(ticket);
            },
            postCfg = {
                headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' },
                transformRequest: transFn
            };
            $scope.genCode = function (ticket) {
                $http.post(url, ticket, postCfg)
                .success(function () {

                })
                    .error(function (data, status, headers, config) {
                        alert("error");
                    })


            }

        };
    </script>
    <script type="text/javascript" src="../JSLibrary/jquery-1.8.3.min.js"></script>
    <script type="text/javascript" src="../JSLibrary/SelectControl.js"></script>
    <script src="http://apps.bdimg.com/libs/angular.js/1.2.15/angular.min.js"></script>
</body>
</html>